import 'package:flutter/material.dart';
import 'package:flutterdemo01/demo3/pages/FirstNewsListPage.dart';


main() {
  runApp(MyMainPage3());
}


class MyMainPage3 extends StatelessWidget {
  const MyMainPage3({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(primaryColor: Colors.green),
      home: Scaffold(
        body: Center(

          child: ElevatedButton(
            onPressed: () {
              Navigator.of(context).push(

                MaterialPageRoute(builder: (context) {
                  return FirstNewsListPage();
                })

              );
            },
            child: Text('点击'),
          ),
        ),
      ),
    );
  }
}


// class MyMainPage3 extends StatefulWidget {
//   const MyMainPage3({Key? key}) : super(key: key);
//
//   @override
//   _MyMainPage3State createState() => _MyMainPage3State();
// }
//
// class _MyMainPage3State extends State<MyMainPage3> {
//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//       theme: ThemeData(primaryColor: Colors.green),
//       home: Scaffold(
//         body: Center(
//
//           child: ElevatedButton(onPressed: (){
//
//             Navigator.of(context).push(
//               MaterialPageRoute(builder: (context){return FirstNewsListPage();})
//             );
//
//           }, child: Text('点击跳转'),),
//         ),
//
//       ),
//
//     );
//   }
// }
